/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package prim;

public class Edge implements Comparable<Edge> {

    Node target;
    Node parent;
    int distance;

    public Edge(Node p, Node n, int dist) {
        parent = p;
        target = n;
        distance = dist;
    }

    @Override
    public int compareTo(Edge o) {

        if (this.distance == o.distance) {
            return 0;
        }
        if (this.distance < o.distance) {
            return -1;
        }
        return 1;
    }
}
